import { Button, Modal } from 'antd';
import { useState } from 'react';
import BuyPointsModal from '../BuyPoints/BuyPoints';
import BuyVipModal from '../BuyVip/BuyVip';
import './VipPopup.less';
export default function VipPopup(props: any) {
    const [isModalOpen, setisModalOpen] = useState(false);
    const [isModalOpenPoints, setisModalOpenPoints] = useState(false);
    function buyScore() {
        // history.push('/BuyPoints');
        setisModalOpenPoints(true);
    }
    function buyVip() {
        // history.push('/MemberCenter');
        setisModalOpen(true);
    }

    return (
        <>
            <Modal
                onCancel={props.onChange}
                keyboard={false}
                // maskClosable={false}
                title={null}
                closeIcon={null}
                open={props.vipShow}
                footer={null}
                className="vipModal"
            >
                <div className="popup-warp">
                    <div className="popup-box">
                        <Button
                            onClick={() => {
                                buyScore();
                            }}
                            className="vip-button customStyle1"
                        >
                            购买积分
                        </Button>
                        <Button
                            onClick={() => {
                                buyVip();
                            }}
                            className="vip-button customStyle2"
                        >
                            立即开通
                        </Button>
                    </div>
                </div>
            </Modal>
            <BuyVipModal
                isModalOpen={isModalOpen}
                setisModalOpen={setisModalOpen}
            ></BuyVipModal>
            <BuyPointsModal
                isModalOpen={isModalOpenPoints}
                setisModalOpen={setisModalOpenPoints}
            />
        </>
    );
}
